package me.huanmeng.heater.command.defaults;

import com.google.common.base.Joiner;
import me.huanmeng.heater.command.Command;
import me.huanmeng.heater.sender.Channel;
import me.huanmeng.heater.sender.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * 2021/10/4<br>
 * Heater<br>
 *
 * @author huanmeng_qwq
 */
public class TestCommand extends Command {
    public TestCommand() {
        super("test");
    }

    @Override
    public void execute(@NotNull CommandSender sender, @Nullable Channel channel, @NotNull String label, @NotNull List<String> args) {
        if (channel != null) {
            channel.sendMessage(String.format("You are in channel execute: /%s %s", label, Joiner.on(" ").join(args)));
        }else{
            sender.sendMessage(String.format("You are in private execute: /%s %s", label, Joiner.on(" ").join(args)));
        }
    }
}
